import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import NewsItem from '../../../components/NewsItem/NewsItem'
import './newsDetail.scss'
import {news} from '../../../config/news';

export default class NewsDetail extends Component {

  config = {
    navigationBarTitleText: ''
  }


  render () {
    let {id, title, time, source}= this.$router.params
    return (
      <View className='newsDetail'>
        <View className='article'>
          <View className='article_h1'>{title}</View>
          <View className='article_info'>
            <View className='article_info_source'>来源：{source}</View>
            <View className='article_info_time'>发布日期：{time}</View>
          </View> 
          <Text className='article_section' decode space>
            {news[id-1]}
          </Text>
        </View>
        <View className='newsRecommend'>
          <View className='newsRecommend_title_row'>
            <View className='newsRecommend_title'>相关动态</View>
            <View className='newsRecommend_change'>
              <View className='newsRecommend_change_icon'></View>换一批
            </View>
          </View>
          <View className='newsRecommend_content'>
            <NewsItem url='1' title='湖南省人民政府办公厅关于印发《湖南省优化经济发展环境规定》的通知' time='2019.05.24' source='来源：中国政府网'></NewsItem>
            <NewsItem url='1' title='娄底市人民政府关于加快推进现代服务业发展的若干意见' time='2019.05.24' source='来源：中国政府网'></NewsItem>
          </View>
        </View>
      </View>
    )
  } 
}
